<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="/js/jquery-1.8.2.min.js"></script>
<link rel="stylesheet" href="/css/css.css">
<title>Insert title here</title>
</head>
<body>
<form:form action="add.do" modelAttribute="job" method="post">
	影视名称:<form:input path="jname" id="jname"/>
			<form:errors path="jname"></form:errors><br><br>
	题材:<select name="story1">
		<option>请选择</option>
		</select>&nbsp;&nbsp;
		
		<select name="story2">
		<option>请选择</option>
		</select>&nbsp;&nbsp;
		
		<select name="story3">
		<option>请选择</option>
		</select>&nbsp;&nbsp;<br><br>
	投资金额:<form:input path="start"/><form:errors path="start"></form:errors> ~
	<input type="text" name="end">万元<br><br>
	影视介绍:<textarea rows="10px" cols="38px" name="introduction"></textarea><br><br>
	影视亮点:<input type="text" name="lnames">&nbsp;&nbsp;&nbsp;<input type="text" name="lnames">
	&nbsp;&nbsp;&nbsp;<input type="text" name="lnames"><br><br>
	上映时间:<input type="date" name="date"><br><br>
	<form:button id="b">保存</form:button>
</form:form>
</body>
<script type="text/javascript">
		$.getJSON("liststory.do",function(r){
			for(var i in r){
				var op=$("<option value="+r[i].id+">"+r[i].name+"</option>");
				$("[name=story1]").append(op);
			}
		})
		$("[name=story1]").change(function(){
			var pid=$(this).val();
			$.getJSON("liststory.do?pid="+pid,function(r){
				$("[name=story2]").empty();
				for(var i in r){
					var op=$("<option value="+r[i].id+">"+r[i].name+"</option>");
					$("[name=story2]").append(op);
				}
			})
		})
		$("[name=story2]").change(function(){
			var pid=$(this).val();
			$.getJSON("liststory.do?pid="+pid,function(r){
				$("[name=story3]").empty();
				for(var i in r){
					var op=$("<option value="+r[i].id+">"+r[i].name+"</option>");
					$("[name=story3]").append(op);
				}
			})
		})
		$("form").submit(function(){
			var jname=$("#jname").val();
			alert("已成功创建影视["+jname+"]")
		})
</script>
</html>